/**
 * @type {import('eslint').Rule.RuleModule}
 */
const rule0 = {
  create(context) {
    return {
      Program(node) {
        context.report({
          node,
          message: "Program node found",
        });
      },
    };
  },
};

/**
 * Custom rule to warn about debugger statements with detailed information
 * @type {import('eslint').Rule.RuleModule}
 */
const noDebuggerWarning = {
  meta: {
    type: "problem",
    docs: {
      description: "Warn about debugger statements in code",
      category: "Possible Errors",
      recommended: true,
    },
    messages: {
      foundDebugger:
        "Found debugger statement at line {{line}}, column {{column}}. This should be removed before committing to production.",
    },
    schema: [],
  },
  create(context) {
    return {
      DebuggerStatement(node) {
        if (!node.loc) {
          return;
        }

        context.report({
          node,
          messageId: "foundDebugger",
          data: {
            line: node.loc.start.line,
            column: node.loc.start.column + 1,
          },
        });
      },
    };
  },
};

export { noDebuggerWarning, rule0 };
